﻿using System;
using System.Web.Script.Services;
using System.Web.Services;
using MS.InformationManagement.BLL.UserProfileManagement;
using MS.InformationManagement.Support;
using MS.InformationManagement.Support.Constants;
using MS.InformationManagement.Core;
using MS.InformationManagement.Core.Support;
using MS.InformationManagement.DAL.DocumentCenter;

namespace MS.InformationManagement.Services
{
    /// <summary>
    /// Summary description for DocumentSchedulerService
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)] 
    //[ScriptService]
    public class DocumentsQuery : System.Web.Services.WebService
    {
        [WebMethod]
        public bool LoadImageToRadicado(int idSelectedItemToCapture, byte[] fileContent, string radicadoId, string siteUrl) {
            try
            {
                FileEntity fileContentEntity = new FileEntity();
                fileContentEntity.FileContent = fileContent;
                fileContentEntity.FileName = radicadoId;
                fileContentEntity.FileSize = fileContent.Length;
                var captureProcess = new BLL.CaptureModule.CaptureProcess(idSelectedItemToCapture, fileContentEntity, siteUrl);
                captureProcess.Execute();
                return true;
            }
            catch (Exception ex)
            {
                throw;
            }
        }        
    }
}
